﻿
Namespace("sketch.framework");

(function () {
    var fwk = sketch.framework;
    fwk.Brush = klass(null, {
        _consructor: function(){
            this.cssColor = null;
        },
        apply:function(context, callback){
            context.save();
            context.fillStyle = this.cssColor;
            callback(context);
            context.restore();
        }
    });

    fwk.Brush.create = function(color){
        var brush = new fwk.Brush();
        brush.cssColor = color;
        return brush;
    };

    fwk.Brush.Black = fwk.Brush.create('#000');
    fwk.Brush.White = fwk.Brush.create('#fff');

    fwk.Stroke = klass(null, {
        _consructor: function(){
            this.cssColor = null;
            this.lineWidth = 1;
        },
        apply:function(context, callback){
            context.save();
            context.strokeStyle = this.cssColor;
            context.lineWidth = this.lineWidth;
            callback(context);
            context.restore();
        }
    });

    fwk.Stroke.create = function(color, width){
        var stroke = new fwk.Stroke();
        stroke.cssColor = color;
        stroke.lineWidth = width;
        return stroke;
    };

    fwk.Stroke.Black = fwk.Stroke.create('#000', 1);
    fwk.Stroke.White = fwk.Stroke.create('#fff', 1);
})();